﻿<Window xmlns:my="clr-namespace:CodeBuilder2.View.CB_UserControl.Content"  x:Class="CodeBuilder2.View.FloatWindow.SimpleFloatWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="SimpleFloatWindow" MinHeight="300" MaxHeight="700" MinWidth="250" WindowStyle="None" Background="Transparent" Name="sfWnd" AllowsTransparency="True" ShowInTaskbar="False" SizeToContent="WidthAndHeight"
        MouseLeftButtonUp="sfWnd_MouseLeftButtonUp" Loaded="sfWnd_Loaded">
    <Window.Resources>
        <Storyboard x:Key="fadeOut">
            <DoubleAnimation From="0.6" To="1" Duration="0:0:0.5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="sfWnd" />
        </Storyboard>
    </Window.Resources>
    <!--<Window.Triggers>
        <EventTrigger RoutedEvent="MouseLeftButtonUp">
            <BeginStoryboard>
                <Storyboard>                    
                    <DoubleAnimation From="0.6" To="1" Duration="0:0:0.5" Storyboard.TargetProperty="Opacity" />
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
    </Window.Triggers>-->
    <Border CornerRadius="5" BorderThickness="6" Name="border" BorderBrush="#FF0D0D93" MouseEnter="Border_MouseEnter" MouseLeave="Border_MouseLeave" MouseMove="Border_MouseMove" MouseLeftButtonUp="border_MouseLeftButtonUp">
        <Grid ShowGridLines="True" Name="grdContainer">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Grid Background="AliceBlue">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" MinWidth="48" />
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <TextBlock Name="tbkPanelName" MouseMove="tbkPanelName_MouseMove" Background="Yellow" MouseLeftButtonUp="tbkPanelName_MouseLeftButtonUp">
                    <TextBlock.Triggers>
                        <EventTrigger RoutedEvent="MouseLeftButtonDown" >
                                        <BeginStoryboard>
                <Storyboard>
                    <DoubleAnimation From="1" To="0.6" Duration="0:0:0.5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="sfWnd"/>
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>                        
        <EventTrigger RoutedEvent="MouseLeftButtonUp">
            <BeginStoryboard>
                <Storyboard>                    
                    <DoubleAnimation From="0.6" To="1" Duration="0:0:0.5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="sfWnd"/>
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
                    </TextBlock.Triggers>
                </TextBlock>
                <Button Grid.Column="1" Content="选项"></Button>
                <!--<Button Grid.Column="2" Content="最大化"></Button>-->
                <Button Grid.Column="3" Click="Button_Click">X</Button>
            </Grid>
        </Grid>
    </Border>
</Window>
